/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ing.sisval.bl;

import java.util.ArrayList;
import org.ing.sisval.be.BEInfraestructura;
import org.ing.sisval.da.DAInfraestructura;
import org.ing.sisval.ds.DSUtil;
import org.rx.cr.bl.BLAbstract;
import org.rx.cr.conf.Config;

/**
 *
 * @author Mysham
 */
public class BLInfraestructura extends BLAbstract<BEInfraestructura> {

    private DAInfraestructura dao;

    public BLInfraestructura(Config conf) {
        setDSConeccion(DSUtil._DSConneccion(conf));
    }

    @Override
    public int registrar(BEInfraestructura tipo) throws Exception {
        dao = new DAInfraestructura(getConeccion());
        return dao.registrar(tipo);
    }

    @Override
    public int actualizarRegistro(BEInfraestructura tipo) throws Exception {
        dao = new DAInfraestructura(getConeccion());
        return dao.actualizarRegistro(tipo);
    }

    @Override
    public int eliminarRegistro(BEInfraestructura tipo) throws Exception {
        dao = new DAInfraestructura(getConeccion());
        return dao.eliminarRegistro(tipo);
    }

    @Override
    public ArrayList<BEInfraestructura> buscarReferencia(String string) throws Exception {
        dao = new DAInfraestructura(getConeccion());
        return dao.buscarReferencia(string);
    }

    @Override
    public ArrayList<BEInfraestructura> listar() throws Exception {
        dao = new DAInfraestructura(getConeccion());
        return dao.listar();
    }

    @Override
    public BEInfraestructura buscar(int i) throws Exception {
        dao = new DAInfraestructura(getConeccion());
        return dao.buscar(i);
    }

}
